import request from '@/utils/request'

// 查询工单信息列表
export function listMworkorder(query) {
  return request({
    url: '/prodmanage/mworkorder/list',
    method: 'get',
    params: query
  })
}

// 查询工单信息详细
export function getMworkorder(feedingId) {
  return request({
    url: '/prodmanage/mworkorder/feed/' + feedingId,
    method: 'get'
  })
}

// 新增工单信息
export function addMworkorder(data) {
  return request({
    url: '/prodmanage/mworkorder',
    method: 'post',
    data: data
  })
}

// 修改工单信息
export function updateMworkorder(data) {
  return request({
    url: '/prodmanage/mworkorder',
    method: 'put',
    data: data
  })
}

// 删除工单信息
export function delMworkorder(feedingId) {
  return request({
    url: '/prodmanage/mworkorder/' + feedingId,
    method: 'delete'
  })
}

// 导出工单信息
export function exportMworkorder(query) {
  return request({
    url: '/prodmanage/mworkorder/export',
    method: 'get',
    params: query
  })
}

// 发料工单信息
export function readyMworkorder(data) {
  return request({
    url: '/prodmanage/mworkorder/ready',
    method: 'put',
    data: data
  })
}

// 收料工单信息
export function receivedMworkorder(data) {
  return request({
    url: '/prodmanage/mworkorder/received',
    method: 'post',
    data: data
  })
}

// 保存工单信息
export function retainMworkorder(data) {
  return request({
    url: '/prodmanage/mworkorder/retain',
    method: 'post',
    data: data
  })
}

// 上料工单信息
export function loadingMworkorder(data) {
  return request({
    url: '/prodmanage/mworkorder/loading',
    method: 'post',
    data: data
  })
}

// 查询发料仓库
export function listWarehouse(query) {
  return request({
    url: '/prodmanage/mworkorder/listbaseStock',
    method: 'get',
    params: query
  })
}


// 查询库存调拨列表
export function listTransfer(query) {
  return request({
    url: '/warehouse/transfer/list',
    method: 'get',
    params: query
  })
}

// 查询库存调拨详细
export function getTransfer(transferId) {
  return request({
    url: '/warehouse/transfer/' + transferId,
    method: 'get'
  })
}

// 查询仓库id 仓库名称
export function listStock(goodsId) {
  return request({
    url: '/prodmanage/mworkorder/' + goodsId,
    method: 'get',
  })
}

// 查询仓库id 仓库名称
export function listStockId(query) {
  return request({
    url: '/prodmanage/mworkorder/stockk',
    method: 'get',
    params: query
  })
}